<template>
	<view class="page-index">
		<view class="search">
			<view class="search-box">
				<image src="/static/index/search.png" mode="" class="searchImage"></image>
				<input type="text" class="searchInput" v-model="form.title" placeholder="请输入您要查询的内容" @confirm='search()'/>
				<image src="/static/index/close.png" mode="" class="searchImage" @click="close()"></image>
			</view>
		</view>
		<view class="list-box">
			<view class="item-box" v-for="(item,index) in list" :key="index" @click="itemBnt(item)">
				<view class="left-box">
					<image :src="'https://yunchenbucket.oss-cn-qingdao.aliyuncs.com/'+item.headPhoto" class="left-img" mode=""></image>
				</view>
				<view class="right-box">
					<view class="name-box">
						<view class="name">
							{{item.title}}
						</view>
						<view class="status">
							优质商家
						</view>
					</view>
					<view class="type-box">
						水果店
					</view>
					<view class="phone-box">
						<view class="icon">

						</view>
						<view class="text">
							{{item.phone}}
						</view>
					</view>
					<view class="address">
						<view class="icon">

						</view>
						<view class="text">
							{{item.address}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import * as index from '@/api/index.js'
	export default {
		data() {
			return {
				list: [],
				form:{
					title:''
				}
			}
		},
		onLoad(params) {
			this.merchant()
		},
		methods: {
			merchant() {
				index.getMercharList().then(res => {
					this.list = res.page
				})
			},
			itemBnt(e) {
				uni.navigateTo({
					url: '/pages/home/fruits/details/index?id=' + e.id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page-index {
		min-height: 100%;
		background: #F9F9F9;
		position: relative;
		.search{
			background: #fff;
			padding: 32rpx;
			.search-box{
				display: flex;
				justify-content: space-between;
				align-items:center;
				border: 2rpx solid #e6e6e6;
				border-radius: 16rpx;
				padding: 16rpx;
				.searchImage{
					width: 66rpx;
					height: 66rpx;
					flex-shrink: 0;
				}
				.searchInput{
					padding: 0 16rpx;
					width: 100%;
					height: 100%;
				}
			}
		}
		.list-box {
			background-color: #ffffff;
			margin-top: 11rpx;
			padding-left: 34rpx;

			.item-box {
				padding-top: 28rpx;
				display: flex;

				// align-items: center;
				.left-box {
					width: 168rpx;
					height: 168rpx;
					border-radius: 18rpx;
					padding-bottom: 28rpx;

					.left-img {
						background: #CD83B0;
						width: 100%;
						height: 100%;
						border-radius: 18rpx;
					}
				}

				.right-box {
					width: 496rpx;
					margin-left: 23rpx;
					padding-bottom: 28rpx;
					border-bottom: 1px solid #EAEAEA;
					;

					.name-box {
						display: flex;
						align-items: center;

						.name {
							font-size: 34rpx;
							font-family: Microsoft YaHei;
							font-weight: 400;
							color: #171717;
						}

						.status {
							margin-left: 12rpx;
							font-size: 17rpx;
							font-family: Microsoft YaHei;
							font-weight: 400;
							font-style: italic;
							color: #F68062;
						}
					}

					.type-box {
						margin-top: 10rpx;
						font-size: 24.8rpx;
						color: #3B82EE;
					}

					.phone-box {
						margin-top: 10rpx;
						display: flex;
						align-items: center;

						.icon {
							width: 21rpx;
							height: 21rpx;
							background-color: #CD83B0;
						}

						.text {
							margin-left: 10rpx;
							font-size: 24.8rpx;
							color: #646368;
						}
					}

					.address {
						margin-top: 10rpx;
						display: flex;
						align-items: center;

						.icon {
							width: 21rpx;
							height: 21rpx;
							background-color: #CD83B0;
						}

						.text {
							margin-left: 10rpx;
							font-size: 24.8rpx;
							color: #646368;
						}
					}
				}

			}
		}
	}
</style>